package net.awpspace.mobile.form;

import javax.microedition.midlet.MIDlet;

import net.awpspace.mobile.global.Global;
import net.awpspace.mobile.management.book.BookManagement;
import net.awpspace.mobile.management.contact.ContactManagement;
import net.awpspace.mobile.management.house.HouseManagement;
import net.awpspace.mobile.management.note.NoteManagement;
import net.awpspace.mobile.management.point.PointManagement;

import com.sun.lwuit.Button;
import com.sun.lwuit.Command;
import com.sun.lwuit.Container;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.layouts.BoxLayout;

/**
 * Menu form
 * 
 * @author Diep
 * 
 */
public class MenuForm extends BaseForm {

	public MenuForm(MIDlet app, BaseForm parent) {
		super(app, parent);
		setTitle(Global.NAME_GROUP);
		setTransitionInAnimator(CommonTransitions.createSlide(
				CommonTransitions.SLIDE_VERTICAL, true, 1200));
		setTransitionOutAnimator(CommonTransitions.createSlide(
				CommonTransitions.SLIDE_VERTICAL, true, 1200));
		setLayout(new BorderLayout());

		Container ctn = new Container(new BoxLayout(BoxLayout.Y_AXIS));
		ctn.addComponent(new Button(new Command(Global.MENU_RESULT) {

			public void actionPerformed(ActionEvent e) {
				new PointManagement(MenuForm.super.app, MenuForm.this).show();
			}
		}));
		ctn.addComponent(new Button(new Command(Global.MENU_PHONE) {

			public void actionPerformed(ActionEvent e) {
				new ContactManagement(MenuForm.super.app, MenuForm.this).show();
			}
		}));
		ctn.addComponent(new Button(new Command(Global.MENU_BOOK) {

			public void actionPerformed(ActionEvent e) {
				new BookManagement(MenuForm.super.app, MenuForm.this).show();
			}
		}));
		ctn.addComponent(new Button(new Command(Global.MENU_NOTES) {

			public void actionPerformed(ActionEvent e) {
				new NoteManagement(MenuForm.super.app, MenuForm.this).show();
			}
		}));
		ctn.addComponent(new Button(new Command(Global.MENU_HOUSE) {

			public void actionPerformed(ActionEvent e) {
				new HouseManagement(MenuForm.super.app, MenuForm.this).show();
			}
		}));

		addComponent(BorderLayout.CENTER, ctn);
	}

	protected void processCommand(ActionEvent e) {
	}
}
